package org.yefei.homeworkday22;

import java.util.Calendar;
import java.util.Scanner;

public class Preview {
	public static void main(String[] args) {
		/*
		 * 8、预习： 一家商场每月8号,18号,28号是会员日，当天会员卡顾客购物打八折。 要求用户输入购物金额、是否是会员，计算出实际要付的金额。。。
		 */
		Calendar ca = Calendar.getInstance();
		ca.set(Calendar.DATE, 8);
		int i = ca.get(Calendar.DATE);

		ca.set(Calendar.DATE, 18);
		int j = ca.get(Calendar.DATE);

		ca.set(Calendar.DATE, 28);
		int k = ca.get(Calendar.DATE);

		Scanner in = new Scanner(System.in);
		System.out.println("请输入购物金额：");
		int money = in.nextInt();
		System.out.println("请输入当日几号：");
		int date = in.nextInt();
		System.out.println("是否是会员（y/n）：");
		String answer = in.next();
		if (answer.equals("y") && (date == i || date == j || date == k)) {
			money = (int) (money * 0.8);
			System.out.println("实际付钱：" + money);
		} else {
			System.out.println("实际付钱：" + money);
		}

	}
}
